import type { ProColumns } from '@ant-design/pro-table';

export type columnsDataType = {
  curDate: string;
  updatedBy: string;
  ccyPair: string;
  curCcyQty: Date;
  velOfCirc: Date;
  totalValueOfComm: number;
  disturbFactor: Date;
  exchangeRate: number;
  qw: string;
  age: number;
};
// 表头
const columnsData: ProColumns<columnsDataType>[] = [
  // 配置搜索框
  {
    title: '生效日期',
    dataIndex: 'curDate',
    hideInTable: true,
    valueType: 'dateRange',
    search: {
      transform: (value) => {
        return {
          startDate: value[0],
          endDate: value[1],
        };
      },
    },
  },
  {
    title: '修改者',
    dataIndex: 'updatedBy',
    hideInTable: true,
    fieldProps: {
      maxLength: 20
    },
  },
  {
    title: '有无修改扰动因子',
    dataIndex: 'status',
    valueType: 'select',
    hideInTable: true,
    formItemProps: {
      labelCol: { span: 10 }
    },
    valueEnum: {
      0: {
        text: '有'
      },
      1: {
        text: '无'
      },
    },
  },
  {
    title: '货币对',
    dataIndex: 'ccyPair',
    valueType: 'select',
    initialValue: '0',
    hideInTable: true,
    valueEnum: {
      0: {
        text: 'HPC:CAD'
      },
    },
  },
  // table里面的内容
  {
    title: '生效日期',
    dataIndex: 'curDate',
    fixed: 'left',
    valueType: 'date',
    hideInSearch: true,
    width: 120
  },
  {
    title: '货币对',
    dataIndex: 'ccyPair',
    hideInSearch: true,
    width: 80
  },
  {
    title: '生效汇率',
    dataIndex: 'exchangeRate',
    hideInSearch: true,
    width: 100
  },
  {
    title: '扰动因子',
    dataIndex: 'disturbFactor',
    hideInSearch: true,
    width: 100
  },
  {
    title: '修改者',
    dataIndex: 'updatedBy',
    hideInSearch: true,
    width: 100
  },
  {
    title: '流通量(M)',
    dataIndex: 'curCcyQty',
    width: 160,
    hideInSearch: true,
  },
  {
    title: '流通速度',
    dataIndex: 'velOfCirc',
    hideInSearch: true,
    width: 80
  },
  {
    title: '商品价值(Q)',
    dataIndex: 'totalValueOfComm',
    hideInSearch: true,
    width: 160
  },
  {
    title: '日环比',
    dataIndex: 'qw',
    hideInSearch: true,
    width: 100
  },
  {
    title: '月同比',
    dataIndex: 'age',
    hideInSearch: true,
    width: 100
  }
]

export default columnsData